import config from '../config/config';
import request from '../utils/request';

let service = {};

// 签到
service.signconch = (param, cb) => {
  param = param || {};

  let requestUrl = config.api.signconch;
  request({
    url: requestUrl,
    // showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    }
  });
}
// 签到详细
service.showdays = (param, cb) => {
  param = param || {};

  let requestUrl = config.api.showdays;
  request({
    url: requestUrl,
    // showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    }
  });
}

//特惠商品列表
service.getcheap_goods = (param, cb) => {
  param = param || {};

  let requestUrl = config.api.getcheap_goods;
  request({
    url: requestUrl,
    // showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    }
  });
}
//通过邀请好友获得的贝壳和好友头像

service.showshareUser = (param, cb) => {
  param = param || {};

  let requestUrl = config.api.showshareUser;
  request({
    url: requestUrl,
    // showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    }
  });
}
//签到提醒
service.setremind = (param, cb) => {
  param = param || {};

  let requestUrl = config.api.setremind;
  request({
    url: requestUrl,
    // showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    }
  });
}

//2.9贝壳专区
service.getConchGoods = (param, cb) => {
  param = param || {};

  let requestUrl = config.api.getConchGoods;
  request({
    url: requestUrl,
    showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    }
  });
}

//2.12.0做任务
service.browserGoodsMine = (param, cb) => {
  param = param || {};

  let requestUrl = config.api.browserGoodsMine;
  request({
    url: requestUrl,
    // showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    }
  });
}

//召唤好友头像
service.showrecallfriendpic = (param, cb) => {
  param = param || {};

  let requestUrl = config.api.showrecallfriendpic;
  request({
    url: requestUrl,
    // showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    }
  });
}

//连续签到七天，首次进入页面有3元奖励提醒
service.signdayremind = (param, cb) => {
  param = param || {};

  let requestUrl = config.api.signdayremind;
  request({
    url: requestUrl,
    // showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    }
  });
}
module.exports = service;